package cn.myjerry.collection2;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Employee {
	private int Id;
	private String Name;
	private int Salary;
	private String Department;
	private Date hireDate;
	public Employee() {}
	public Employee(int id, String name, int salary, String department, String hireDate) {
		super();
		Id = id;
		Name = name;
		Salary = salary;
		Department = department;
		SimpleDateFormat date = new SimpleDateFormat("yyyy-MM");
		try {
			this.hireDate = date.parse(hireDate);
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}
	/**
	 * @return the id
	 */
	public int getId() {
		return Id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		Id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return Name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		Name = name;
	}
	/**
	 * @return the salary
	 */
	public int getSalary() {
		return Salary;
	}
	/**
	 * @param salary the salary to set
	 */
	public void setSalary(int salary) {
		Salary = salary;
	}
	/**
	 * @return the department
	 */
	public String getDepartment() {
		return Department;
	}
	/**
	 * @param department the department to set
	 */
	public void setDepartment(String department) {
		Department = department;
	}
	/**
	 * @return the hireDate
	 */
	public Date getHireDate() {
		return hireDate;
	}
	/**
	 * @param hireDate the hireDate to set
	 */
	public void setHireDate(String hireDate) {
		SimpleDateFormat date = new SimpleDateFormat("yyyy-MM");
		try {
			this.hireDate = date.parse(hireDate);
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}
}